<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 100px;
            height: 100px;
            background-color: blueviolet;
        }

        .box2 {
            width: 400px;
            height: 600px;
            border: 1px solid;
            
            background-color: chocolate;
            /* 背景图片 */
            background-image: url("./images/bz04.jpg");
            /* 背景图片平铺 */
            background-repeat: no-repeat;
            /* 背景图片位置 */
            background-position: center;
            /* 背景图片大小 */
            background-size: contain;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>

</html>